﻿namespace OpenLS.Spreadsheet.Formats.Biff.Records
{
    internal abstract class CondFmtRecordBase: WorksheetLevelRecord
    {
        internal override sealed void Apply(BiffReaderWorksheetContext context)
        {
            context.AddCondFmtRecord(this);
            context.WorkbookContext.GetActions(ActionType.ConditionalFormatting).Add(
                obj => context.Worksheet.AddConditionalFormatting(ToConditionalFormatting(context)));

            //context.CurrentConditionalFormatting = ToConditionalFormatting(context.Worksheet);
        }

        protected abstract ConditionalFormatting ToConditionalFormatting(BiffReaderWorksheetContext context);
    }
}